#!/usr/bin/env bash

#install
if [ 0 = `rpm -qa|grep vsftpd|wc -l` ]; then
    echo "install vsftpd..."
    yum install vsftpd
    systemctl start vsftpd
    systemctl enable vsftpd
fi
#enable port 21
firewall-cmd --zone=public --permanent --add-port=21/tcp
firewall-cmd --zone=public --permanent --add-service=ftp
firewall-cmd --reload
echo "enable port 21 success"
#configuration
cp /etc/vsftpd/vsftpd.conf /etc/vsftpd/vsftpd.conf.bak
